<?php
header("content-type:text/html;charset=utf-8");
include "../config/mysql.php";
session_start();
if(isset($_SESSION['username'])){

    $id=$_POST["id"];
    $title=$_POST["title"];
    $author=$_POST["author"];
    $content=$_POST["content"];
    $kid=$_POST["modules"];
    // echo $kid;
    // exit;
    // var_dump($_POST);
    // exit;
    $content = htmlspecialchars($content); 
   
           
    $tr=$pdo->exec("update article_content set title='$title',author='$author',kid=$kid,content='$content' where id=$id");

 
     
                 if($tr){
                 	header("refresh:1;url=../new.php");
                 	print("修改成功,请稍后..<br>");
                 }
                 else{
                 	header("refresh:10;url=../newedit.php?id=$id");
                 	print("修改失败,请稍后..<br>");
                 }


}else{
    header("Location:../log.php");
      exit();
}
?>